package com.asnike.display{
	import flash.display.*;
	
	public class ASGraphics{
		static public function get SPRITE():Sprite{
			return new Sprite
		}
		static public function get SHAPE():Shape{
			return new Shape
		}
		static public function getArg():ASGraphicsArg{
			var arg:ASGraphicsArg;
			
			arg = new ASGraphicsArg;
			
			return arg;
		}
		static public function draw( $arg:ASGraphicsArg ):*{
			var graphics:Graphics;
			
			graphics = $arg.target.graphics;
			graphics.beginFill( $arg.colorFill );
			if( $arg.colorLine === ASGraphicsArg.LINE_NONE ){}else{
				graphics.lineStyle( $arg.thickness, $arg.colorLine );
			}
			switch( $arg.getType() ){
			case ASGraphicsArg.RECT:
				graphics.drawRect( 0, 0, $arg.width, $arg.height );
				break;
			case ASGraphicsArg.ROUND_RECT:
				graphics.drawRoundRect( 0, 0, $arg.width, $arg.height, $arg.round, $arg.round );
				break;
			case ASGraphicsArg.CIRCLE:
				graphics.drawCircle( 0, 0, $arg.radius );
				break;
			case ASGraphicsArg.CUSTOM_LINE:
				graphics.drawPath( $arg.command, $arg.data );
				break;
			}
			graphics.endFill();
			
			return $arg.target;
		}
	}
}